<template > 
    <div id="startLecture"> 
            <topMenu ref = "topMenu"></topMenu>
            <contentDom ref = "contentDom" ></contentDom>
    </div>
</template>
<script>
import { bus }  from '../../../main.js';
import contentDom from './content.vue'
import topMenu from './topMenu.vue';
import pagePublic from "@/mixins/pagePublic.js";
import { mapMutations, mapState } from "vuex";
    export default {
        name: "tem",
        mixins: [pagePublic],
        components: {
            contentDom,
            topMenu
        },
        data(){
            return{
                datas:{
                    info:{}
                }
                // urls:{
                //     list: {
                //         url:this.$api.tem.list,
                //         method:"get",
                //         sync:false,
                //     },
                //     add:this.$api.tem.add,
                //     edit:this.$api.tem.edit,
                //     del:this.$api.tem.del
                // },

                
            }
        },
        computed: {
            ...mapState(['configInfo']),

        },
        created() {
            console.log(22222222)
            bus.$on('leftMenuClick',(e)=>{
                console.log(e,12121)
                this.info = e
                this.init()
            });
            // if(this.info){
            //     this.info = localStorage.getItem('defaultMenu');
            // }
            // this.init();
        },
        methods:{
            ...mapMutations(['set_configInfo']),
            init(){
                this.$nextTick(()=>{
                    this.$refs.topMenu.init(this.info?JSON.stringify(this.info):localStorage.getItem('defaultMenu'))
                    this.$refs.contentDom.init(this.info?JSON.stringify(this.info):localStorage.getItem('defaultMenu'))
                })
               
            },
        }
    }
</script>
<style src="../this.scss" lang="scss"></style>
<style src="./this.scss" lang="scss"></style>
<style lang="scss" scoped>

</style>